package com.google.code.sapwcrawler.download.procedure;

import java.net.URL;
import java.util.concurrent.Semaphore;

public class LimitedDownloadProc extends DownloadProcDecorator
{
	private Semaphore semaphore;
	
	public void setSemaphore(Semaphore v)
	{
		this.semaphore = v;
	}
	
	@Override
	public void download(URL url) throws Exception
	{
		semaphore.acquire();
		getDownloadProc().download(url);
		semaphore.release();
	}
}
